Paris Saint-Germain needed late goals from substitutes Javier Pastore and Edinson Cavani to see off Ligue 2 side Niort in the Coupe de France and book their spot in the quarter-finals.